package com.education.teach.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.education.teach.R;
import com.education.teach.mvp.model.bean.CoursewareBean;
import com.education.teach.mvp.model.bean.MyClassBean;

import java.util.List;

import dn.easy.common.commonutils.TimeUtil;
import dn.easy.common.constant.Contans;

public class MyClassAdapter extends BaseQuickAdapter<MyClassBean.ResultBean.QueryListBean, BaseViewHolder> {
    Context context;

    public MyClassAdapter(int layoutResId, @Nullable List<MyClassBean.ResultBean.QueryListBean> data, Context context) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyClassBean.ResultBean.QueryListBean item) {
        helper.setText(R.id.title, item.getName())
                .setText(R.id.desp, item.getDesp())
                .setText(R.id.share, item.getState() == 1 ? "已分享" : "未分享")
                .setVisible(R.id.share, true).addOnClickListener(R.id.share)
                .setText(R.id.time, TimeUtil.formatData(TimeUtil.dateFormatYMDofChinese, item.getCreateDate()))
                .setText(R.id.creName, "作者：" + item.getXueshengName());
    }
}
